package chepter04.example14;
abstract class Animal{
    abstract void shout();    //定义抽象shout（）方法
}
//    定义Cate类继承Animal抽象类
class Cat extends Animal{
    void shout(){
        System.out.println("喵喵······");
    }
}
//    定义Dog类继承Animal抽象类
class Dog extends Animal{
    void shout(){
        System.out.println("汪汪······");
    }
}
//定义测试
public class Example14 {
    public static void main(String[] args) {
        Animal and1 = new Cat();
        Animal and2 = new Dog();
        and1.shout();
        and2.shout();
    }
}
